﻿namespace WatiN.Extensions
{
    using global::WatiN.Core;

    public static class DivCollectionExtensions
    {
        public static bool Exists(this DivCollection divCollection, string divIdOrNameOrValueorClass, bool extension = true)
        {
            return divCollection.Exists(Find.ById(divIdOrNameOrValueorClass)) ||
                divCollection.Exists(Find.ByName(divIdOrNameOrValueorClass)) ||
                divCollection.Exists(Find.ByValue(divIdOrNameOrValueorClass)) ||
                divCollection.Exists(Find.ByClass(divIdOrNameOrValueorClass)) ||
                divCollection.Exists(Find.ByLabelText(divIdOrNameOrValueorClass));
        }
    }
}